﻿using ChinaUnicom.ViewModels;
using Microsoft.Phone.Controls;
using System;
using System.Windows;
using System.Windows.Navigation;

namespace ChinaUnicom.Views
{
    public partial class FeeHistoriesListPage : PhoneApplicationPage
    {
        FeeHistoriesListContext dataContext { get { return DataContext as FeeHistoriesListContext; } }

        public FeeHistoriesListPage()
        {
            InitializeComponent();

            Loaded += OnPageLoaded;
        }

        void OnPageLoaded(object sender, RoutedEventArgs e)
        {
            DataContext = new FeeHistoriesListContext();
        }
                
        private void OnDownloadClick(object sender, EventArgs e)
        {
            dataContext.ForceUpdateHistories();
        }

        private void OnBackClick(object sender, EventArgs e)
        {
            NavigationService.GoBack();
        }
    }
}